package com.share.three.e_aop_annotation_tx.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.share.three.e_aop_annotation_tx.dao.AccountDaoImpl;


@Service
public class AccountServiceImpl implements AccountService {
	
	@Autowired
	AccountDaoImpl accountDaoImpl;

	@Override
	@Transactional(isolation=Isolation.DEFAULT, propagation=Propagation.REQUIRED)
	public void transfer(String outer, String inner, int money) {
		accountDaoImpl.out(outer, money);
//		int i = 1/0;
		accountDaoImpl.in(inner, money);
	}

}
